/**
 * 流程图存储对象
 * @returns
 */
function BkfmWorkFlowConfig(){
	var bkfmWorkFlowConfig = new Map();
	//流程编码
	bkfmWorkFlowConfig.set("workflow_code",null);
	//流程名称
	bkfmWorkFlowConfig.set("workflow_name",null);
	//流程图配置文件
	bkfmWorkFlowConfig.set("workflow_xml",null);
	//流程状态，默认有效
	bkfmWorkFlowConfig.set("workflow_status","Y");
	
	this.bkfmWorkFlowConfig = bkfmWorkFlowConfig;
};
/**
 * 获取流程编码
 */
BkfmWorkFlowConfig.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowConfig.get("workflow_code");
};
/**
 * 设置流程编码
 */
BkfmWorkFlowConfig.prototype.setWorkFlowCode = function(workFlowCode){
	this.bkfmWorkFlowConfig.set("workflow_code",workFlowCode);
};
/**
 * 获取流程名称
 */
BkfmWorkFlowConfig.prototype.getWorkFlowName = function(){
	return this.bkfmWorkFlowConfig.get("workflow_name");
};
/**
 * 设置流程名称
 */
BkfmWorkFlowConfig.prototype.setWorkFlowName = function(workFlowName){
	this.bkfmWorkFlowConfig.set("workflow_name",workFlowName);
};
/**
 * 获取流程图解析文件
 */
BkfmWorkFlowConfig.prototype.getWorkFlowXml = function(){
	return this.bkfmWorkFlowConfig.get("workflow_xml");
};
/**
 * 设置流程图解析文件
 */
BkfmWorkFlowConfig.prototype.setWorkFlowXml = function(workFlowXml){
	this.bkfmWorkFlowConfig.set("workflow_xml",workFlowXml);
};
/**
 * 获取流程图状态
 */
BkfmWorkFlowConfig.prototype.getWorkFlowStatus = function(){
	return this.bkfmWorkFlowConfig.get("workflow_status");	
};
/**
 * 设置流程图状态
 * param workFlowStatus 流程状态Y/N
 */
BkfmWorkFlowConfig.prototype.setWorkFlowStatus = function(workFlowStatus){
	this.bkfmWorkFlowConfig.set("workflow_status",workFlowStatus);
};



/**
 * 流程节点列表
 * @returns
 */
function BkfmWorkFlowNodes(){
	var bkfmWorkFlowNodes = new Array();
	
	
	this.bkfmWorkFlowNodes = bkfmWorkFlowNodes;
}

BkfmWorkFlowNodes.prototype.getBkfmWorkFlowNodes = function(){
	return this.bkfmWorkFlowNodes;
}
BkfmWorkFlowNodes.prototype.addBkfmWorkFlowNode = function(bkfmWorkFlowNode){
	this.bkfmWorkFlowNodes.push(bkfmWorkFlowNode);
}
BkfmWorkFlowNodes.prototype.getBkfmWorkFlowNode = function(node_code){
	for(i in this.bkfmWorkFlowNodes){
		var bkfmWorkFlowNode = this.bkfmWorkFlowNodes[i];
		if(node_code == bkfmWorkFlowNode.getNodeCode()){
			return bkfmWorkFlowNode;
		}
	}
	return null;
}
BkfmWorkFlowNodes.prototype.setBkfmWorkFlowNode = function(bkfmWorkFlowNode){
	for(i in this.bkfmWorkFlowNodes){
		var oldBkfmWorkFlowNode = this.bkfmWorkFlowNodes[i];
		if(oldBkfmWorkFlowNode.getNodeCode() == bkfmWorkFlowNode.getNodeCode()){
			this.bkfmWorkFlowNodes[i] = bkfmWorkFlowNode;
			break;
		}
	}
}

/**
 * 流程节点
 * @returns
 */
function BkfmWorkFlowNode(rwid){
	var bkfmWorkFlowNode = new Map();
	bkfmWorkFlowNode.set("rwid",rwid || Utils.getRwid());
	//节点编码
	bkfmWorkFlowNode.set("node_code",null);
	//节点名称
	bkfmWorkFlowNode.set("node_name",null);
	//所属流程编码
	bkfmWorkFlowNode.set("workflow_code",null);
	//坐标
	bkfmWorkFlowNode.set("node_point",null);
	//节点类型
	bkfmWorkFlowNode.set("node_type",null);
	//节点对应查看表单名称
	bkfmWorkFlowNode.set("form_name",null);
	
	this.bkfmWorkFlowNode = bkfmWorkFlowNode;
}
/**
 * 获取流程表对象唯一编码
 */
BkfmWorkFlowNode.prototype.getRwid = function(){
	return this.bkfmWorkFlowNode.get("rwid");
};
BkfmWorkFlowNode.prototype.getRwid = function(){
	return this.bkfmWorkFlowNode.set("rwid");
};
/**
 * 设置流程表对象唯一编码
 */
BkfmWorkFlowNode.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNode.set("rwid",rwid);
};

BkfmWorkFlowNode.prototype.getNodeCode = function(){
	return this.bkfmWorkFlowNode.get("node_code");
}
BkfmWorkFlowNode.prototype.setNodeCode = function(node_code){
	this.bkfmWorkFlowNode.set("node_code",node_code);
}

BkfmWorkFlowNode.prototype.getNodeName = function(){
	return this.bkfmWorkFlowNode.get("node_name");
}
BkfmWorkFlowNode.prototype.setNodeName = function(node_name){
	this.bkfmWorkFlowNode.set("node_name",node_name);
}

BkfmWorkFlowNode.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNode.get("workflow_code");
}
BkfmWorkFlowNode.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNode.set("workflow_code",workflow_code);
}

BkfmWorkFlowNode.prototype.getNodePoint  = function(){
	return this.bkfmWorkFlowNode.get("node_point");
}
BkfmWorkFlowNode.prototype.setNodePoint = function(node_point){
	this.bkfmWorkFlowNode.set("node_point",node_point);
}

BkfmWorkFlowNode.prototype.getNodeType = function(){
	return this.bkfmWorkFlowNode.get("node_type");
}
BkfmWorkFlowNode.prototype.setNodeType = function(node_type){
	this.bkfmWorkFlowNode.set("node_type",node_type);
}

BkfmWorkFlowNode.prototype.getFormName = function(){
	return this.bkfmWorkFlowNode.get("form_name");
}
BkfmWorkFlowNode.prototype.setFormName = function(form_name){
	this.bkfmWorkFlowNode.set("form_name",form_name);
}


/**
 * 流程连接线列表
 * @returns
 */
function BkfmWorkFlowLines(){
	var bkfmWorkFlowLines = new Array();
	
	
	this.bkfmWorkFlowLines = bkfmWorkFlowLines;
}
BkfmWorkFlowLines.prototype.getBkfmWorkFlowNodes = function(){
	return this.bkfmWorkFlowLines;
}
BkfmWorkFlowLines.prototype.addBkfmWorkFlowNode = function(bkfmWorkFlowLine){
	this.bkfmWorkFlowLines.push(bkfmWorkFlowLine);
}
BkfmWorkFlowLines.prototype.getBkfmWorkFlowNode = function(action_code){
	for(i in this.bkfmWorkFlowLines){
		var bkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(action_code == bkfmWorkFlowLine.getActionCode()){
			return bkfmWorkFlowNode;
		}
	}
	return null;
}
BkfmWorkFlowLines.prototype.setBkfmWorkFlowNode = function(bkfmWorkFlowLine){
	for(i in this.bkfmWorkFlowLines){
		var oldBkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(oldBkfmWorkFlowLine.getActionCode() == bkfmWorkFlowLine.getActionCode()){
			this.bkfmWorkFlowLines[i] = bkfmWorkFlowLine;
			break;
		}
	}
}

/**
 * 流程节点动作,流程连接线节点
 * @returns
 */
function BkfmWorkFlowLine(rwid){
	var bkfmWorkFlowLine = new Map();
	bkfmWorkFlowLine.set("rwid",rwid || Utils.getRwid());
	//原节点编码
	bkfmWorkFlowLine.set("sourcenode_id",null);
	//原节点名称
	bkfmWorkFlowLine.set("sourcenode_name",null);
	//流转条件
	bkfmWorkFlowLine.set("conditions",null);
	//动作节点编码,line_code/node_code/action_code
	bkfmWorkFlowLine.set("action_code",null);
	//动作名称
	bkfmWorkFlowLine.set("action_name",null);
	//目标节点编码
	bkfmWorkFlowLine.set("targetnode_id",null);
	//目标节点名称
	bkfmWorkFlowLine.set("targetnodename",null);
	
	this.bkfmWorkFlowLine = bkfmWorkFlowLine;
}
/**
 * 设置流程表对象唯一编码
 */
BkfmWorkFlowLine.prototype.getRwid = function(){
	return this.bkfmWorkFlowLine.get("rwid");
};
BkfmWorkFlowLine.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowLine.set("rwid",rwid);
};
BkfmWorkFlowLine.prototype.getSourceNodeId = function(){
	return this.bkfmWorkFlowLine.get("sourcenode_id");
}
BkfmWorkFlowLine.prototype.setSourceNodeId = function(sourcenode_id){
	this.bkfmWorkFlowLine.set("sourcenode_id",sourcenode_id);
}
BkfmWorkFlowLine.prototype.getSourceNodeName = function(){
	return this.bkfmWorkFlowLine.get("sourcenode_name");
}
BkfmWorkFlowLine.prototype.setSourceNodeName = function(sourcenode_name){
	this.bkfmWorkFlowLine.set("sourcenode_name",sourcenode_name);
}
BkfmWorkFlowLine.prototype.getConditions = function(){
	return this.bkfmWorkFlowLine.get("conditions");
}
BkfmWorkFlowLine.prototype.setConditions = function(conditions){
	this.bkfmWorkFlowLine.set("conditions",conditions);
}
BkfmWorkFlowLine.prototype.getActionCode = function(){
	return this.bkfmWorkFlowLine.get("action_code");
}
BkfmWorkFlowLine.prototype.setActionCode = function(action_code){
	this.bkfmWorkFlowLine.set("action_code",action_code);
}
BkfmWorkFlowLine.prototype.getActionName = function(){
	return this.bkfmWorkFlowLine.get("action_name");
}
BkfmWorkFlowLine.prototype.setActionName = function(action_name){
	this.bkfmWorkFlowLine.set("action_name",action_name);
}
BkfmWorkFlowLine.prototype.getTargetNodeId = function(){
	return this.bkfmWorkFlowLine.get("targetnode_id");
}
BkfmWorkFlowLine.prototype.setTargetNodeId = function(targetnode_id){
	this.bkfmWorkFlowLine.set("targetnode_id",targetnode_id);
}
BkfmWorkFlowLine.prototype.getTagetNodeName = function(){
	return this.bkfmWorkFlowLine.get("targetnode_name");
}
BkfmWorkFlowLine.prototype.setTargetNodeName = function(targetnode_name){
	this.bkfmWorkFlowLine.set("targetnode_name",targetnode_name);
}




/*流程节点人员权限对象*/
function BkfmWorkFlowNodeUserPermis(rwid){
	var bkfmWorkFlowNodeUserPermis = new Map();
	bkfmWorkFlowNodeUserPermis.set("rwid",rwid || Utils.getRwid());
	bkfmWorkFlowNodeUserPermis.set("user_no",null);
	bkfmWorkFlowNodeUserPermis.set("node_id",null);
	bkfmWorkFlowNodeUserPermis.set("workflow_code",null);
	
	this.bkfmWorkFlowNodeUserPermis = bkfmWorkFlowNodeUserPermis;
}
BkfmWorkFlowNodeUserPermis.prototype.getRwid = function(){
	return this.bkfmWorkFlowNodeUserPermis.get("rwid");
};
BkfmWorkFlowNodeUserPermis.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNodeUserPermis.set("rwid",rwid);
};
BkfmWorkFlowNodeUserPermis.prototype.getUserNo = function(){
	return this.bkfmWorkFlowNodeUserPermis.get("user_no");
}
BkfmWorkFlowNodeUserPermis.prototype.setUserNo = function(user_no){
	this.bkfmWorkFlowNodeUserPermis.set("user_no",user_no);
}
BkfmWorkFlowNodeUserPermis.prototype.getNodeId = function(){
	return this.bkfmWorkFlowNodeUserPermis.get("node_id");
}
BkfmWorkFlowNodeUserPermis.prototype.setNodeId = function(node_id){
	this.bkfmWorkFlowNodeUserPermis.set("node_id",node_id);
}
BkfmWorkFlowNodeUserPermis.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNodeUserPermis.get("workflow_code");
}
BkfmWorkFlowNodeUserPermis.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNodeUserPermis.set("workflow_code",workflow_code);
}
/*流程节点角色权限*/
function BkfmWorkFlowNodeRolePermis(rwid){
	var bkfmWorkFlowNodeRolePermis = new Map();
	bkfmWorkFlowNodeRolePermis.set("rwid",rwid || Utils.getRwid());
	bkfmWorkFlowNodeRolePermis.set("role_id",null);
	bkfmWorkFlowNodeRolePermis.set("node_id",null);
	bkfmWorkFlowNodeRolePermis.set("workflow_code",null);
	
	this.bkfmWorkFlowNodeRolePermis = bkfmWorkFlowNodeRolePermis;
}
BkfmWorkFlowNodeRolePermis.prototype.getRwid = function(){
	return this.bkfmWorkFlowNodeRolePermis.get("rwid");
};
BkfmWorkFlowNodeRolePermis.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNodeRolePermis.set("rwid",rwid);
};
BkfmWorkFlowNodeRolePermis.prototype.getRoleId = function(){
	return this.bkfmWorkFlowNodeRolePermis.get("role_id");
}
BkfmWorkFlowNodeRolePermis.prototype.setRoleId = function(role_id){
	this.bkfmWorkFlowNodeRolePermis.set("role_id",role_id);
}
BkfmWorkFlowNodeRolePermis.prototype.getNodeId = function(){
	return this.bkfmWorkFlowNodeRolePermis.get("node_id");
}
BkfmWorkFlowNodeRolePermis.prototype.setNodeId = function(node_id){
	this.bkfmWorkFlowNodeRolePermis.set("node_id",node_id);
}
BkfmWorkFlowNodeRolePermis.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNodeRolePermis.get("workflow_code");
}
BkfmWorkFlowNodeRolePermis.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNodeRolePermis.set("workflow_code",workflow_code);
}
/*流程节点部门权限*/
function BkfmWorkFlowNodeDeptPermis(rwid){
	var bkfmWorkFlowNodeDeptPermis = new Map();
	bkfmWorkFlowNodeDeptPermis.set("rwid",rwid || Utils.getRwid());
	bkfmWorkFlowNodeDeptPermis.set("org_id",null);
	bkfmWorkFlowNodeDeptPermis.set("node_id",null);
	bkfmWorkFlowNodeDeptPermis.set("workflow_code",null);
	
	this.bkfmWorkFlowNodeDeptPermis = bkfmWorkFlowNodeDeptPermis;
}
BkfmWorkFlowNodeDeptPermis.prototype.getRwid = function(){
	return this.bkfmWorkFlowNodeDeptPermis.get("rwid");
};
BkfmWorkFlowNodeDeptPermis.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNodeDeptPermis.set("rwid",rwid);
};
BkfmWorkFlowNodeDeptPermis.prototype.getOrgId = function(){
	return this.bkfmWorkFlowNodeDeptPermis.get("org_id");
}
BkfmWorkFlowNodeDeptPermis.prototype.setOrgId = function(org_id){
	this.bkfmWorkFlowNodeDeptPermis.set("org_id",org_id);
}
BkfmWorkFlowNodeDeptPermis.prototype.getNodeId = function(){
	return this.bkfmWorkFlowNodeDeptPermis.get("node_id");
}
BkfmWorkFlowNodeDeptPermis.prototype.setNodeId = function(node_id){
	this.bkfmWorkFlowNodeDeptPermis.set("node_id",node_id);
}
BkfmWorkFlowNodeDeptPermis.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNodeDeptPermis.get("workflow_code");
}
BkfmWorkFlowNodeDeptPermis.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNodeDeptPermis.set("workflow_code",workflow_code);
}

















/**
 * 工作流程所使用的表
 * @returns
 */
function BkfmWorkFlowTables(){
	var bkfmWorkFlowTables = new Array();
	
	this.bkfmWorkFlowTables = bkfmWorkFlowTables;
};
/**
 * 获取流程对应的表
 */
BkfmWorkFlowTables.prototype.getWorkFlowTables = function(){
	return this.bkfmWorkFlowTables;
};

/**
 * 获取单个流程表对象
 * @param form_path 业务表路径
 */
BkfmWorkFlowTables.prototype.getWorkFlowTable = function(form_path){
	for(i in this.bkfmWorkFlowTables){
		var workFlowTable = this.bkfmWorkFlowTables[i];
		if(form_path == workFlowTable.getFormPath()){
			return workFlowTable;
		}
	}
	return null;
};

/**
 * 添加表对象,返回最新的业务表列表
 * @param workFlowTable BkfmWorkFlowTable
 */
BkfmWorkFlowTables.prototype.addWorkFlowTable = function(workFlowTable){
	this.bkfmWorkFlowTables.push(workFlowTable);
	//返回最新的业务表列表
	return this.bkfmWorkFlowTables;
};

/**
 * 根据form_path表路径，更新对应的表对象信息
 * 返回最新的业务表列表
 * @param form_path 业务表路径
 * @param workFlowTable BkfmWorkFlowTable
 */
BkfmWorkFlowTables.prototype.updateWorkFlowTable = function(form_path,workFlowTable){
	for(i in this.bkfmWorkFlowTables){
		var oldWorkFlowTable = this.bkfmWorkFlowTables[i];
		if(oldWorkFlowTable.getFormPath() == workFlowTable.getFormPath()){
			this.bkfmWorkFlowTables[i] = workFlowTable;
			break;
		}
	}
	//返回最新的业务表列表
	return this.bkfmWorkFlowTables;
};






/**
 * 工作流表对象
 * @param rwid指定表对象的唯一编码
 * @returns
 */
function BkfmWorkFlowTable(rwid){
	var workFlowTable = new Map();
	
	//分配默认id，不存在则重新生成新的id
	workFlowTable.set("rwid",rwid || Utils.getRwid());
	
	//所属流程
	workFlowTable.set("workflow_code",null);
	
	//所属表名
	workFlowTable.set("form_name",null);
	
	//所属表路径
	workFlowTable.set("form_path",null);
	
	//业务表类型0	主表;1	明细表
	workFlowTable.set("table_type",null);
	
	this.workFlowTable = workFlowTable();
};

/**
 * 获取流程表对象唯一编码
 */
BkfmWorkFlowTable.prototype.getRwid = function(){
	return this.workFlowTable.get("rwid");
};

/**
 * 设置流程表对象唯一编码
 */
BkfmWorkFlowTable.prototype.setRwid = function(rwid){
	this.workFlowTable.set("rwid",rwid);
};

/**
 * 获取流程表所属流程编码
 */
BkfmWorkFlowTable.prototype.getWorkFlowCode = function(){
	return this.workFlowTable.get("workflow_code");
};

/**
 * 设置流程表所属流程编码
 */
BkfmWorkFlowTable.prototype.setWorkFlowCode = function(workFlowCode){
	this.workFlowTable.set("workflow_code",workFlowCode);
};

/**
 * 获取表名
 */
BkfmWorkFlowTable.prototype.getFormName = function(){
	return this.workFlowTable.get("form_name");
};
/**
 * 设置表名
 */
BkfmWorkFlowTable.prototype.setFormName = function(formName){
	this.workFlowTable.set("form_name",formName);
};

/**
 * 获取表路径
 */
BkfmWorkFlowTable.prototype.getFormPath = function(){
	return this.workFlowTable.get("form_path");
};

/**
 * 获取表路径
 */
BkfmWorkFlowTable.prototype.setFormPath = function(form_path){
	this.workFlowTable.set("form_path",form_path);
};
/**
 * 获取表类型
 */
BkfmWorkFlowTable.prototype.getFormType = function(){
	return this.workFlowTable.get("form_type");
};
/**
 * 设置表类型
 */
BkfmWorkFlowTable.prototype.setFormType = function(formType){
	this.workFlowTable.set("form_type",form_type);
};













